<?php
	require_once("pub.php");
	require_once(_ROOT."/db.php");
	require_once(_ROOT."/am/title.php");	
	/**
	 * function sql_query($sql)
	 * 	{
	 * 		$data = mysql_query($sql, $conn);
	 * 		while ($arr = mysql_fetch_array($data))
	 * 		{
	 * 			echo 'query success!';	
	 * 		}	
	 * 		
	 * 	}
	 */
	// 测试类型，1为添加，2为更新，3为删除
	$var_type = '1';
	// 操作类型， 1为标题，2为正文
	$var_op   = '1';	
	// 添加
	if ($var_type == '1' and $var_op=='1')
	{
		//$sql = "select * from t_title where t_mark='20100411' and t_tid='0001'";
		//$data = mysql_query($sql, $conn);
?>
	<form action="process.php?ID=1&op=1" method="POST">
	<?php require(_ROOT."/am/m_head.php");?>
	<table width="768" align="center"><tr><td>
		Title:<textarea name="title" rows="8" cols="70"></textarea></td></tr><tr><td>
		Start:<textarea name="start" rows="1" cols="70"></textarea></td></tr><tr><td>
		End:<textarea name="end" rows="1" cols="70"></textarea></td></tr><tr><td></table>
<?php
	}
	else if ($var_type == '1' and $var_op =='2')
	{
		//$sql = "select * from t_text where t_mark='20100411' and t_eid='0001'";
		//$data = mysql_query($sql, $conn);
?>
	<form action="process.php?ID=1&op=2" method="POST">
	<?php require(_ROOT."/am/m_head.php");?>
	<table width="768" align="center"><tr><td>
		Text:<textarea name="ques" rows="8" cols="70"></textarea></td></tr><tr><td>
		A:<textarea name="opta" rows="1" cols="70"></textarea></td></tr><tr><td>
		B:<textarea name="optb" rows="1" cols="70"></textarea></td></tr><tr><td>
		C:<textarea name="optc" rows="1" cols="70"></textarea></td></tr><tr><td>
		D:<textarea name="optd" rows="1" cols="70"></textarea></td></tr><tr><td>
		Key:<textarea name="key" rows="1" cols="70"></textarea></td></tr><tr><td>
		KeyEx:<textarea name="keyEx" rows="2" cols="70"></textarea></td></tr><tr><td>
		Point:<textarea name="point" rows="1" cols="70"></textarea></td></tr><tr><td></table>
<?php
	}
	else if ($var_type == '2' and $var_op =='1')
	{
		$sql = "select * from t_title where t_mark='20100411' and t_tid='0001'";
		$data = mysql_query($sql, $conn);
		while ($arr = mysql_fetch_array($data))
		{
			//echo $arr['t_title'];
		?>
	<form action="process.php?ID=2&op=1&str=0001" method="POST">
	<?php //require(_ROOT."/am/m_head.php");?>
	<table width="768" align="center"><tr><td>
		Title:<textarea name="title" rows="8" cols="70"><?php echo $arr['t_title'];?></textarea></td></tr><tr><td>
		Start:<textarea name="start" rows="1" cols="70"><?php echo $arr['t_eid_start'];?></textarea></td></tr><tr><td>
		End:<textarea name="end" rows="1" cols="70"><?php echo $arr['t_eid_end'];?></textarea></td></tr><tr><td></table>
		<?php
		}
	}
	else if ($var_type == '2' and $var_op =='2')
	{
		$sql = "select * from t_text where t_mark='20100411' and t_eid='0001'";
		$data = mysql_query($sql, $conn);
		while ($arr = mysql_fetch_array($data))
		{
		?>
	<form action="process.php?ID=2&op=2&str=0001" method="POST">
	<?php //require(_ROOT."/am/m_head.php");?>
	<table width="768" align="center"><tr><td>
		Text:<textarea name="ques" rows="8" cols="70"><?php echo $arr['t_ques'];?></textarea></td></tr><tr><td>
		A:<textarea name="opta" rows="1" cols="70"><?php echo $arr['opta'];?></textarea></td></tr><tr><td>
		B:<textarea name="optb" rows="1" cols="70"><?php echo $arr['optb'];?></textarea></td></tr><tr><td>
		C:<textarea name="optc" rows="1" cols="70"><?php echo $arr['optc'];?></textarea></td></tr><tr><td>
		D:<textarea name="optd" rows="1" cols="70"><?php echo $arr['optd'];?></textarea></td></tr><tr><td>
		Key:<textarea name="key" rows="1" cols="70"><?php echo $arr['t_key'];?></textarea></td></tr><tr><td>
		KeyEx:<textarea name="keyEx" rows="2" cols="70"><?php echo $arr['t_keyEx'];?></textarea></td></tr><tr><td>
		Point:<textarea name="point" rows="1" cols="70"><?php echo $arr['t_point'];?></textarea></td></tr><tr><td></table>
		<?php
		}
		mysql_free_result($data);
	}
?>
	<table width="768" align="center">
		<tr>
			<td>
			<input type="submit" value="submit"/>
			</td>
		</tr>
	</table>
	</form>
<?php

?>
<?php
	require_once(_ROOT."/am/bottom.php");
?>